/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package agregar;

import java.awt.Button;
import java.awt.Color;
import java.awt.FlowLayout;
import java.awt.Frame;
import java.awt.GridLayout;
import java.awt.Panel;
import java.awt.TextArea;
import java.awt.TextField;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.JFrame;
import javax.swing.JOptionPane;

/**
 *
 * @author Lab
 */
public class Main extends JFrame implements ActionListener{


    public static void main(String[] args) {
        // TODO code application logic here
    Frame f = new Frame();
        FlowLayout flo = new FlowLayout();//acomoda distancia uno en otro de izquierda a derecha

        f.addWindowListener(new WindowAdapter() {

            public void windowClosing(WindowEvent e) {
                System.exit(0);
            }
        });

TextField t=new TextField(30);
t.setEditable( false );

TextArea a=new TextArea();
Button b=new Button("agregar");
Panel p= new Panel();
Panel p1= new Panel();
Panel p2= new Panel();

        f.setLayout(new GridLayout(1, 0));///pone columna y filas

  //  f.add(BorderLayout.SOUTH,t);
   // f.add(BorderLayout.CENTER,a);

    a.setBackground(Color.BLACK);//color de fondo
    f.add(p);
    f.add(p1);
    f.add(p2);
    
    p.add(t);
    p.add(a);
    p1.add(b);



 f.setVisible(true);
    f.setSize(500, 500);

    }
    }


